import React from 'react';
import { Layout } from 'antd';
import { Outlet, Routes, Route } from 'react-router-dom';
import Sidebar from '../../components/layout/Sidebar';
import { globalInfoMenu } from '../../constants/sideMenus';
import Overview from './Overview';
import ProductList from './ProductList';
import ProductDetail from './ProductDetail';
import OrderList from './OrderList';
import OrderDetail from './OrderDetail';
import TransactionAnalysis from './TransactionAnalysis';
import ConnectorList from './ConnectorList';
import ResourceList from './ResourceList';
import ResourceDetail from './ResourceDetail';
import DictionaryList from './DictionaryList';
import DictionaryDetail from './DictionaryDetail';
import SemanticRuleList from './SemanticRuleList';
import SemanticRuleDetail from './SemanticRuleDetail';
import UserList from './UserList';
import UserDetail from './UserDetail';
import './styles.css';

const GlobalInfo: React.FC = () => {
  return (
    <Layout className="global-info-layout">
      <Sidebar menuItems={globalInfoMenu} basePath="/global-info" />
      <Layout.Content className="global-info-content">
        <Routes>
          <Route index element={<Overview />} />
          <Route path="product-list" element={<ProductList />} />
          <Route path="product/:id" element={<ProductDetail />} />
          <Route path="order-list" element={<OrderList />} />
          <Route path="order/:id" element={<OrderDetail />} />
          <Route path="transaction-analysis" element={<TransactionAnalysis />} />
          <Route path="connector-list" element={<ConnectorList />} />
          <Route path="user-list" element={<UserList />} />
          <Route path="user/:id" element={<UserDetail />} />
          <Route path="user/add" element={<UserDetail />} />
          <Route path="resource-list" element={<ResourceList />} />
          <Route path="resource/:id" element={<ResourceDetail />} />
          <Route path="resource-dict" element={<DictionaryList />} />
          <Route path="dictionary/:id" element={<DictionaryDetail />} />
          <Route path="dictionary/add" element={<DictionaryDetail />} />
          <Route path="semantic-rules" element={<SemanticRuleList />} />
          <Route path="semantic-rule/:id" element={<SemanticRuleDetail />} />
          <Route path="semantic-rule/add" element={<SemanticRuleDetail />} />
          <Route path="*" element={<Outlet />} />
        </Routes>
      </Layout.Content>
    </Layout>
  );
};

export default GlobalInfo; 